package com.jh.user.pojo.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 畅捷通道枚举
 */
public enum ChanPay {
    CHANPAYNEWCARD_04("1", "代还商旅04"),
    CHANPAYNEWCARD_0101("2", "畅捷新无卡101"),
    CHANPAYNEWCARD_0102("3", "畅捷新无卡102"),
    CHANPAYNEWCARD2_04("4", "快捷商旅05"),
    CHANPAYNEWCARD("5", "畅捷新无卡地方性")
    ;
    private String value;
    private String desc;

    ChanPay(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static <T extends String> ChanPay of(T n) {
        String val;
        val = n;
        if (StringUtils.isEmpty(val)) {
            return null;
        }
        for (ChanPay chanPay : values()) {
            if (chanPay.getValue().equals(val)) {
                return chanPay;
            }
        }
        return null;
    }
}
